package com.itheim.array;

import java.util.Scanner;

/*
  二维数组求和
 */
public class ArrayDemo09 {
    public static void main(String[] args) {
        Scanner sc= new Scanner(System.in);
        int sum = 0;
        int count = 0;
        int[][] arr = new int[2][3];
        for (int i = 0; i < arr.length; i++) {
            for (int j = 0;j<arr[i].length;j++){
                count++;
                System.out.println("请输入第"+count+"个数:");
                arr[i][j] = sc.nextInt();
                sum += arr[i][j];
            }
        }
        System.out.println("和值为:"+sum);
    }
}
